{ "repo": { "repository": { "name": "repo", "resources": { "workspaces": "/resources/v1/repo" }, "metadata": { "option.retention.supported": "false", "query.xpath.doc.order": "false", ... } } } }
Represents the version of the RESTful API distributed with ModeShape 2. It has been deprecated in ModeShape 3, but is still available using the v1 URL prefix. It provides the following methods:
URL: http://<host>:<port>/<context>/v1/
HTTP Method: GET
Produces: application/json; text/html; text/plain;
Default Output: text/plain
Response Code (if successful): OK
Response Format:
{ "repo": { "repository": { "name": "repo", "resources": { "workspaces": "/resources/v1/repo" }, "metadata": { "option.retention.supported": "false", "query.xpath.doc.order": "false", ... } } } }
URL: http://<host>:<port>/<context>/v1/<repository_name>
HTTP Method: GET
Produces: application/json; text/html; text/plain;
Default Output: text/plain
Response Code (if successful): OK
Response Format:
{ "default": { "workspace": { "name": "default", "resources": { "query": "/resources/v1/repo/default/query", "items": "/resources/v1/repo/default/items" } } } }
Retrieves an item at a given path.
URL: http://<host>:<port>/<context>/v1/<repository_name>/<workspace_name>/items/<item_path>
HTTP Method: GET
Produces: application/json; text/html; text/plain;
Default Output: text/plain
Response Code (if successful): OK
Optional Query Parameters:
depth - a numeric value indicating how many level of children should be retrieved under the node located at path. A negative value indicates all children
mode:depth - same as the above
Response Format:
{ "properties": { "jcr:primaryType": "mode:system" }, "children": [ "jcr:nodeTypes", "jcr:versionStorage", "mode:namespaces", "mode:locks" ] }
Creates a node at the given path, using the body of request as JSON content
URL: http://<host>:<port>/<context>/v1/<repository_name>/<workspace_name>/items/<node_path>
HTTP Method: POST
Produces: application/json; text/html; text/plain;
Default Output: text/plain
Request Content-Type: accepts any, but for this to work it has to be a valid JSON object
Response Code (if successful): CREATED
Optional Query Parameters:
mode:includeNode - indicates if the entire node should be returned in the response or just the path to the new node.
Request Format:
{ "properties":{ "jcr:primaryType":"nt:unstructured", "testProperty":"testValue", "multiValuedProperty":["value1", "value2"] }, "children":{ "childNode":{ "properties":{ "nestedProperty":"nestedValue" } } } }
Response Format:
{"properties":{ "jcr:primaryType":"nt:unstructured", "multiValuedProperty":["value1", "value2"], "testProperty":"testValue" }, "children":{ "childNode":{ "properties":{ "jcr:primaryType":"nt:unstructured", "nestedProperty":"nestedValue" } } }}
Updates a node or a property at the given path, using the body of request as JSON content
URL: http://<host>:<port>/<context>/v1/<repository_name>/<workspace_name>/items/<item_path>
HTTP Method: PUT
Produces: application/json; text/html; text/plain;
Default Output: text/plain
Request Content-Type: accepts any, but for this to work it has to be a valid JSON object
Response Code (if successful): OK
Request Format:
Node: same as the one used when creating
Property:
{"testProperty":"some_new_value"}
Response Format:
Node: same as one used when creating
Property:
{"testProperty":"some_new_value"}
Deletes the node or the property at the given path.
URL: http://<host>:<port>/<context>/v1/<repository_name>/<workspace_name>/items/<item_path>
HTTP Method: DELETE
Produces: none
Response Code (if successful): OK
Executes a JCR query in either: XPath, SQL or SQL2 format, returning a JSON object in response.
URL: http://<host>:<port>/<context>/v1/<repository_name>/<workspace_name>/query
HTTP Method: POST
Produces: application/json; text/html; text/plain;
Request Content-Type: application/jcr+sql; application/jcr+xpath; application/jcr+sql2; application/jcr+search
Default Output: text/plain
Response Code (if successful): OK
Optional Query Parameters:
offset - the index in the result set where to start the retrieval of data
limit - the maximum number of rows to return
Response Format:
{ "types": { "nt:base.jcr:primaryType": "STRING", "nt:base.jcr:mixinTypes": "STRING", "nt:base.jcr:path": "STRING", "nt:base.jcr:name": "STRING", "nt:base.jcr:score": "DOUBLE", "nt:base.mode:localName": "STRING", "nt:base.mode:depth": "LONG" }, "rows": [ { "nt:base.jcr:primaryType": "mode:root", "nt:base.jcr:path": "/", "nt:base.jcr:name": "", "nt:base.jcr:score": "0.3535533845424652", "nt:base.mode:localName": "", "nt:base.mode:depth": "0" }, { "nt:base.jcr:primaryType": "mode:locks", "nt:base.jcr:path": "/jcr:system/mode:locks", "nt:base.jcr:name": "mode:locks", "nt:base.jcr:score": "0.3535533845424652", "nt:base.mode:localName": "locks", "nt:base.mode:depth": "2" } ] }